package application.translators.impl;

import application.model.PluginModel;
import application.model.PluginsModel;
import application.translators.Translator;
import mappings.Plugins;

import java.util.List;

public class PluginsTranslator implements Translator<List<Plugins>, PluginsModel>
{

    @Override
    public PluginsModel translate(List<Plugins> input)
    {
        PluginsModel pluginsModel = new PluginsModel();

        for(Plugins plugin : input)
        {
            PluginModel pluginModel = new PluginModel();

            pluginModel.setId(plugin.getId());
            pluginModel.setName(plugin.getName());

            pluginsModel.addPlugin(pluginModel);
        }

        return pluginsModel;
    }
}
